package com.example.demo.Controller;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

@Controller
public class HelloMvcController {
    @RequestMapping("/helloWorld")
    public String helloworld(Model model) {
        model.addAttribute("mav", "哈哈");
        return "example/hello";
    }
    @RequestMapping("helloWorld2")
    public ModelAndView helloWorld2() throws Exception{
        ModelAndView mav = new ModelAndView("example/hello");
        mav.addObject("mav", "HelloWorldController, spring boot");
        return mav;
    }
}
